package com.boot.dto;

import lombok.Data;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

@Data
public class OperationLogDTO {
    private String method;
    private String uri;
    private String ip;
    private Object requestParams;
    private Object responseBody;
    private int status;
    private long takeTime;
    private LocalDateTime timestamp;

    // 覆盖 getter，输出格式化时间
    public String getTimestamp() {
        return this.timestamp != null ? this.timestamp.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) : "";
    }
}
